<template>
  <div style="position:relative">
    <div class="header">
      <i v-if="showBack" @click="$router.go(-1)" class="iconfont icon-zuojiantou"></i>
      {{ title }}
      <img src="../../../public/img/dianji.png" alt="" class="icon-gengduo" v-if="showTwo" @click="show = !show">
    </div>
    <ul v-if="show">
      <router-link to="/home" tag="li">首页</router-link>
      <router-link to="/board" tag="li">榜单</router-link>
      <router-link to="/information" tag="li">热点</router-link>
      <router-link to="/store" tag="li">商城</router-link>
    </ul>
  </div>
</template>

<script>
export default {
  props: {
    title: {
      type: String,
      default: "猫眼电影"
    },
    showBack: {
      type: Boolean,
      default: true
    },
    showTwo: {
      type: Boolean,
      default: true
    }
  },
  data() {
    return {
      show: false
    };
  }
};
</script>

<style lang="less" scoped>
.header {
  height: 1rem;
  width: 100%;
  background-color: #e54847;
  line-height: 1rem;
  color: white;
  font-size: 0.35rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  font-weight: 500;
  i {
    font-size: 0.35rem;
  }
  .icon-zuojiantou {
    margin-left: 0.2rem;
    font-weight: 900;
    position: absolute;
    left: 0;
  }
  .icon-gengduo {
    width: 0.35rem;
    margin-right: 0.25rem;
    position: absolute;
    right: 0;
    top: 0.31rem;
  }
}
ul {
  position: absolute;
  right: 0.2rem;
  width: 2rem;
  top: 0.8rem;
  background-color: white;
  z-index: 999;
  color: black;
  li {
    height: 0.8rem;
    line-height: 0.8rem;
    box-sizing: border-box;
    width: 100%;
    border-bottom: 1px solid #eee;
    font-size: 0.3rem;
    text-align: center;
    &:last-child {
      border-bottom: none;
    }
  }
}
</style>
